from django.db import models

from lapi_app.models.user_model.user_info import Userinfo


class Environment(models.Model):
    """
    API环境设置
    """
    e_name = models.CharField("API环境名称", max_length=200, null=False)
    e_address = models.CharField("API环境标题名称", max_length=200, null=False)
    e_describe = models.TextField("API环境描述", default="", null=True)
    create_time = models.DateTimeField("创建时间", auto_now_add=True)
    update_time = models.DateTimeField("更新时间", auto_now_add=True)
    e_user = models.ForeignKey(Userinfo, on_delete=models.CASCADE)

    def __str__(self):
        return self.e_name
